﻿<UserControl x:Class="WowModelExplorer.Controls.MapModelSelect"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:data="clr-namespace:WowModelExplorer.Data"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             d:DesignHeight="500"
             d:DesignWidth="300"
             mc:Ignorable="d">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="1" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <Grid Name="_mapGrid" Grid.Row="0">
            <Grid.Resources>
                <data:MapCollection x:Key="_maps" />
            </Grid.Resources>
            <Grid.RowDefinitions>
                <RowDefinition Height="23" />
                <RowDefinition />
            </Grid.RowDefinitions>

            <Grid Grid.Row="0">
                <Border>
                    <TextBox Name="_mapfilter"
                             Margin="1,1,1,1"
                             TextChanged="mapfilter_TextChanged" />
                </Border>
            </Grid>

            <ListView Name="_maplistView"
                      Grid.Row="1"
                      ItemsSource="{Binding Source={StaticResource _maps}}">
                <ListView.View>
                    <GridView>
                        <GridViewColumn Width="150" DisplayMemberBinding="{Binding Path=Name}">
                            <GridViewColumnHeader Click="mapGridViewColumnHeader_Click"
                                                  Content="{DynamicResource mapNames}"
                                                  Tag="Name" />
                        </GridViewColumn>
                        <GridViewColumn Width="60" DisplayMemberBinding="{Binding Path=Type}">
                            <GridViewColumnHeader Click="mapGridViewColumnHeader_Click"
                                                  Content="{DynamicResource type}"
                                                  Tag="Type">
                                <GridViewColumnHeader.ContextMenu>
                                    <ContextMenu Name="mapTypeContextMenu" />
                                </GridViewColumnHeader.ContextMenu>
                            </GridViewColumnHeader>
                        </GridViewColumn>
                        <GridViewColumn Width="100" DisplayMemberBinding="{Binding Path=InternalName}">
                            <GridViewColumnHeader Content="{DynamicResource internalMapNames}"/>
                        </GridViewColumn>
                        <GridViewColumn Width="60" DisplayMemberBinding="{Binding Path=Id}">
                            <GridViewColumnHeader Click="mapGridViewColumnHeader_Click" Tag="Id">ID</GridViewColumnHeader>
                        </GridViewColumn>
                    </GridView>
                </ListView.View>
            </ListView>
        </Grid>

        <GridSplitter Grid.Row="1"
                      Height="1"
                      HorizontalAlignment="Stretch"
                      VerticalAlignment="Top"
                      Background="{DynamicResource EdgeBorderBrush}" />

        <Grid Name="_adtGrid" Grid.Row="2">
            <Grid.Resources>
                <data:AdtCollection x:Key="_adts" />
            </Grid.Resources>
            <Grid.RowDefinitions>
                <RowDefinition Height="23" />
                <RowDefinition />
            </Grid.RowDefinitions>

            <Grid Grid.Row="0">
                <Border>
                    <TextBox Name="_adtfilter"
                             Margin="1,1,1,1"
                             TextChanged="adtfilter_TextChanged" />
                </Border>
            </Grid>

            <ListView Name="_adtlistview"
                      Grid.Row="1"
                      ItemsSource="{Binding Source={StaticResource _adts}}">
                <ListView.View>
                    <GridView>
                        <GridViewColumn Width="200" DisplayMemberBinding="{Binding Path=Name}">
                            <GridViewColumnHeader Content="{DynamicResource mapArea}"/>
                        </GridViewColumn>
                    </GridView>
                </ListView.View>
            </ListView>
        </Grid>

    </Grid>
</UserControl>
